package com.david.client.rpc;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.ServiceDefTarget;

public interface ILoginService extends RemoteService {
	public static final int SUCCESS = 1;

	public static final int NAMENOTEXISTS = 2;

	public static final int PASSWDINVAID = 3;

	public static final int ERROR = 4;

	public static final String SERVICE_URI = "/com.david.ERP/LoginService";

	public static class Util {

		public static ILoginServiceAsync getInstance() {

			ILoginServiceAsync instance = (ILoginServiceAsync) GWT
					.create(ILoginService.class);
			ServiceDefTarget target = (ServiceDefTarget) instance;
			target.setServiceEntryPoint(GWT.getModuleBaseURL() + SERVICE_URI);
			return instance;
		}
	}

	public Integer login(String userName, String password);
	
	public String[] getRoles();
}
